Stored Procedures [dbo].[asi_FindProductBO]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@productKeyuniqueidentifier16
SQL Script
CREATE PROCEDURE [dbo].[asi_FindProductBO]
(
@productKey uniqueidentifier
)
AS
BEGIN
/*
This procedure finds the business object associated with
the ProductType given the ProductKey. This is useful in
instantiating the right Product
*/

-- Find the order
declare @productTypeKey uniqueidentifier

SELECT @productTypeKey = ProductTypeKey from ProductMain
WHERE ProductMain.ProductKey = @productKey

IF (@productTypeKey IS NULL)
BEGIN
RAISERROR ('Cannot find Product', 16, 1)
RETURN
END

select BusinessObjectName from ProductType
where ProductTypeKey = @productTypeKey

END

GO
Uses